<template>
  <div>
    <el-button-group size="medium">
      <slot name="table_btn" />
      <el-button v-permission="editPermission" class="pan-btn tiffany-btn" icon="el-icon-edit" @click="editPage">修改</el-button>
      <el-button v-permission="delPermission" class="pan-btn pink-btn" icon="el-icon-delete" @click="del">删除</el-button>
    </el-button-group>
  </div>
</template>

<script>
import permission from '@/directive/permission/index.js'
export default {
  name: 'TableBtn',
  directives: {
    permission
  },
  props: {
    // 权限code
    editPermission: {
      type: Array,
      default: () => []
    },
    delPermission: {
      type: Array,
      default: () => []
    },
    // 回传参数
    parameter: {
      type: String,
      default: ''
    }
  },
  data() {
    return {}
  },
  methods: {
    editPage() {
      this.$emit('onEditPage', this.parameter)
    },
    del() {
      this.$emit('onDel', this.parameter)
    }
  }
}
</script>

<style lang="scss">
table tr td{
    .el-button-group{
        .pan-btn{
          padding: 10px 15px  ;
        }
      }
}
</style>
